package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.found.common.entity.TimeTaskDTO;
import com.ibeeking.gmc.global.g.rest.service.ITimeTaskService;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/g/timeTask/feign/v1")
public class TimeTaskFeignController {

    @Resource
    private ITimeTaskService timeTaskServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY,describe = "根据id查询定时任务模板")
    @PostMapping(value = "/queryTimeTaskById/{id}")
    public TimeTaskDTO queryTimeTaskById(@PathVariable("id") Long id) {
        return this.timeTaskServiceImpl.queryTimeTaskById(id);
    }

    @Log(logType = OperateLogTypeEnum.QUERY,describe = "查询定时任务模板")
    @PostMapping(value = "/queryTimeTaskByHandler/{industry}/{handler}")
    public TimeTaskDTO queryTimeTaskByHandler(@PathVariable("industry") String industry, @PathVariable("handler") String handler) {
        return this.timeTaskServiceImpl.queryTimeTaskByIndustryAndHandler(industry, handler);
    }

}
